<?
class mysql{
	private $mysql_host;#mysql服务器的地址
	private $mysql_username;#mysql服务器的用户名
	private $mysql_password;#mysql服务器的密码
	private $mysql_dbname;#mysql服务器的数据库名
	private $mysql_link;#mysql服务器的连接
	private $mysql_result;#执行sql语句的结果
	public $fetch_all;#执行sql语句的结果 多维数组
	public $num_rows;#执行sql语句影响的行数
	
	function __construct($mysql_host='localhost',$mysql_username='root',$mysql_password='schedule950200',$mysql_dbname='www_fjsy_site')
	{
		$this->mysql_host=$mysql_host;
		$this->mysql_username=$mysql_username;
		$this->mysql_password=$mysql_password;
		$this->mysql_dbname=$mysql_dbname;
		$this->mysql_link=mysqli_connect($this->mysql_host,$this->mysql_username,$this->mysql_password,$this->mysql_dbname);
	}
	function exec($sql)
	{
		$this->mysql_result=mysqli_query($this->mysql_link,$sql);
		$this->fetch_all=mysqli_fetch_all($this->mysql_result,MYSQLI_BOTH);
		$this->num_rows=mysqli_num_rows($this->mysql_result);
	}
	
}
?>